<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wechat_user', function (Blueprint $table) {
            $table->id();
            $table->string('corp_id')->default('')->comment('企业ID');
            $table->string('open_kfid')->default('')->comment('客服ID');
            $table->string('user_id')->default('')->comment('user id');
            $table->string('reply_content', 1000)->default('')->comment('最新会话内容');
            $table->timestamp('reply_at')->useCurrent()->comment('回复时间');
            $table->tinyInteger('status')->default(0)->comment('用户状态0非活跃1活跃');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wechat_user');
    }
};
